package com.sxhnpg.manager;

import java.util.List;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.sxhnpg.dao.BaseDao;
import com.sxhnpg.dao.TravelDao;
import com.sxhnpg.model.TravelAgencyInfo;
import com.sxhnpg.model.User;


public class TravelManager extends BaseManager{

	private TravelDao travelDao;
	public void setTravelDao(TravelDao travelDao) {
		this.travelDao = travelDao;
	}
	public TravelDao getTravelDao() {
		return travelDao;
	}
	public BaseDao getEntityDao() {
		return this.travelDao;
	}
	
	// 旅行社基本信息列表
	public List<TravelAgencyInfo> findTravelListList(){
		return travelDao.findTravelListList();
	}
	
	// ajax
	public TravelAgencyInfo findTravelInfoByName(String agencyName){
		return travelDao.findTravelInfoByName(agencyName);
	}
	
	// 查出基本信息列表
	public TravelAgencyInfo findBasic(String agencyId){
		return travelDao.findBasic(agencyId);
	}
	
	// 当前月登记列表
	public List<TravelAgencyInfo> findTravelListByMonthTableName(String tableName){
		return travelDao.findTravelListByMonthTableName(tableName);
	}
	
	// 插入数据
	public void insertTravel(String tableName,TravelAgencyInfo travelAgencyInfo){
		travelDao.insertTravel(tableName,travelAgencyInfo);
	}
	
	// 删除数据
	public void removeTravel(String tableName,int id){
		travelDao.removeTravel(tableName,id);
	}
	// 修改数据
	public void updateTravel(String tableName,TravelAgencyInfo travelAgencyInfo){
		travelDao.updateTravel(tableName,travelAgencyInfo);
	}
	// 处理信息
	public void updateHandle(String tableName,int agencyId){
		travelDao.updateHandle(tableName,agencyId);
	}
	// 获得单条数据
	public TravelAgencyInfo findTravel(String tableName,int agencyId){
		return travelDao.findTravel(tableName,agencyId);
	}
}
